package project.parser.ast.aux;

import project.environments.DynamicEnv;
import project.environments.StaticEnv;
import project.parser.ast.stats.Stat;

import java.util.List;

public class AuxStatList<T extends Stat> extends AuxList<T> {
	public AuxStatList(List<T> list) {
		super(list);
	}

	public void typecheckList(StaticEnv senv) {
		for (Stat stat : this)
			stat.typecheck(senv);
	}

	public void evaluateList(DynamicEnv denv) {
		for (Stat stat : this)
			stat.evaluate(denv);
	}

	@Override
	public String toString() {
		StringBuilder strBld = new StringBuilder();
		for (Stat stat : this)
			strBld.append(stat.toString());
		return strBld.toString();
	}
}
